package com.qf.eduadmin.config;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

/**
 * @author Mr.Liu
 * @date 2021/12/29 21:00
 */

public class MD5 {
    public static void main(String[] args) {
        String hash = "MD5";
        String passWord = "root";
        int num = 1024;
        String salt = "zhangsan";//设置盐
        ByteSource bytes = ByteSource.Util.bytes(salt);
        //生成密码 1.加密算法 2.未加密的密码 3.盐 4.加密的次数/散列次数
        SimpleHash simpleHash = new SimpleHash(hash,passWord,bytes,num);
        System.out.println(simpleHash);
    }
}
